<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./js/jquery-3.6.0.js"></script>
  </head>
  <body>
    <input type="text" id="name" value="张三疯" />
  </body>
</html>
<script>
  //如果 js 语法中 既有 dom原生  jq对象  $开头 jq对象  不使用$开头 dom
  //获得dom对象
  var nameComp = document.getElementById('name')
  console.log('dom对象的value属性:' + nameComp.value)
  // dom => jq
  var $name = $(nameComp)
  console.log('jq对象val()方法:' + $name.val())

  // jq对象 转成 dom
  var $name2 = $('#name')
  var nameComp2 = $name2[0]
  var nameComp3 = $name2.get(0)
  //输出
  console.log('jq=>dom:' + nameComp2.value)
  console.log('jq=>dom:' + nameComp3.value)
</script>
